﻿using DevComponents.DotNetBar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Shine.SchemaManager
{
    public partial class ViewItemForm : Office2007Form
    {
        private static ViewItemForm instance = null;
        private 规划项目 project = null;

        private ViewItemForm(规划项目 obj)
        {
            InitializeComponent();
            this.project = obj;
            this.FillData();
        }

        public static ViewItemForm GetInstance(规划项目 obj)
        {
            if (instance == null)
            {
                instance = new ViewItemForm(obj);
            }
            return instance;
        }

        private void FillData()
        {
            this.tbxProjectName.Text = this.project.ProjectName;
            this.tbxNumber.Text = this.project.ProjectNum;
            this.tbxProjectType.Text = this.project.Type;
            this.tbxCompany.Text = this.project.Designer;
            this.tbxStatus.Text = this.project.Status;
            this.tbxOffice.Text = this.project.Zone;
            this.tbxStartDate.Text = this.project.StartDate;
            this.tbxEndDate.Text = this.project.EndDate;
            this.tbxDepartment.Text = this.project.Department;
            this.tbxEmployee.Text = this.project.Operator;
        }

        private void ProjectItemForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Close();
        }
    }
}
